# Maintainer: Jonas Witschel <diabonas@archlinux.org>
pkgname=python-python-socks
pkgver=2.4.3
_tag=298d27f26676b0914360754de71e6d344c272ae2 # git rev-parse "v$pkgver"
pkgrel=1
pkgdesc='Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python'
arch=('any')
url='https://github.com/romis2012/python-socks'
license=('APACHE')
depends=('python') 
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-anyio' 'python-async-timeout' 'python-curio' 'python-flask' 'python-pytest'
              'python-pytest-asyncio' 'python-pytest-trio' 'python-trio' 'python-yarl' 'python-trustme' 'python-tiny-proxy')
optdepends=('python-anyio: anyio support'
            'python-async-timeout: asyncio support'
            'python-curio: curio support'
            'python-trio: trio support')
provides=('python-python_socks')
replaces=('python-python_socks')
source=("git+$url.git?signed#tag=$_tag")
sha512sums=('SKIP')
validpgpkeys=('706A8935FED55F3BFB7C188B5EEAD7400A5D80ED') # Roman Snegirev <rsng@mail.ru>

pkgver() {
	cd "${pkgname#python-}"
	git describe | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g'
}

build() {
	cd "${pkgname#python-}"
	python -m build --wheel --no-isolation
}

check() {
	cd "${pkgname#python-}"
	pytest -k 'not proxy_server'
}

package() {
	cd "${pkgname#python-}"
	python -m installer --destdir="$pkgdir" dist/*.whl
}
